package com.mineapp.base

/**
 * Created by mac on 2017/7/31.
 */
abstract class BasePresenter<V : BaseView> {
    var mView: V? = null
    var mActivity: BaseActivity? = null
    var mFragment: BaseFragment? = null

    fun getActivity(): BaseActivity? {
        return mActivity
    }

    fun getFragment(): BaseFragment? {
        return mFragment
    }

    fun setView(view: V?) {
        if(view != null) {
            mView = view
        }
    }

    fun getView(): V? {
        return mView
    }

    fun removeView() {
        mView = null
    }
}